/*
 Navicat Premium Data Transfer

 Source Server         : mypostgres
 Source Server Type    : PostgreSQL
 Source Server Version : 120003
 Source Host           : localhost:5432
 Source Catalog        : hyatt
 Source Schema         : public

 Target Server Type    : PostgreSQL
 Target Server Version : 120003
 File Encoding         : 65001

 Date: 07/07/2020 15:07:21
*/


-- ----------------------------
-- Sequence structure for booking_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."booking_id_seq";
CREATE SEQUENCE "public"."booking_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."booking_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for feedback_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."feedback_id_seq";
CREATE SEQUENCE "public"."feedback_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."feedback_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Sequence structure for room_id_seq
-- ----------------------------
DROP SEQUENCE IF EXISTS "public"."room_id_seq";
CREATE SEQUENCE "public"."room_id_seq" 
INCREMENT 1
MINVALUE  1
MAXVALUE 2147483647
START 1
CACHE 1;
ALTER SEQUENCE "public"."room_id_seq" OWNER TO "postgres";

-- ----------------------------
-- Table structure for app_user
-- ----------------------------
DROP TABLE IF EXISTS "public"."app_user";
CREATE TABLE "public"."app_user" (
  "username" varchar(10) COLLATE "pg_catalog"."default",
  "password" text COLLATE "pg_catalog"."default",
  "first_name" varchar(32) COLLATE "pg_catalog"."default",
  "last_name" varchar(32) COLLATE "pg_catalog"."default",
  "email" varchar(32) COLLATE "pg_catalog"."default",
  "token" varchar(32) COLLATE "pg_catalog"."default",
  "id" int4
)
;
ALTER TABLE "public"."app_user" OWNER TO "postgres";

-- ----------------------------
-- Records of app_user
-- ----------------------------
BEGIN;
INSERT INTO "public"."app_user" VALUES ('admin', '$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Test', 'Admin', 'admin@hyatt.com', '', NULL);
INSERT INTO "public"."app_user" VALUES ('manager', '$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Test', 'Manager', 'manager@hyatt.com', '', NULL);
INSERT INTO "public"."app_user" VALUES ('customer', '$2a$10$4eqIF5s/ewJwHK1p8lqlFOEm2QIA0S8g6./Lok.pQxqcxaBZYChRm', 'Test', 'Customer', 'customer@test.com', '', NULL);
COMMIT;

-- ----------------------------
-- Table structure for app_user_user_profile
-- ----------------------------
DROP TABLE IF EXISTS "public"."app_user_user_profile";
CREATE TABLE "public"."app_user_user_profile" (
  "user_id" varchar(10) COLLATE "pg_catalog"."default",
  "user_profile_id" varchar(10) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."app_user_user_profile" OWNER TO "postgres";

-- ----------------------------
-- Records of app_user_user_profile
-- ----------------------------
BEGIN;
INSERT INTO "public"."app_user_user_profile" VALUES (NULL, NULL);
INSERT INTO "public"."app_user_user_profile" VALUES (NULL, NULL);
INSERT INTO "public"."app_user_user_profile" VALUES (NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for booking
-- ----------------------------
DROP TABLE IF EXISTS "public"."booking";
CREATE TABLE "public"."booking" (
  "id" int4 NOT NULL DEFAULT nextval('booking_id_seq'::regclass),
  "arrival_time" date,
  "comment" varchar(255) COLLATE "pg_catalog"."default",
  "departure_time" date,
  "people" int4,
  "room_booked" varchar(255) COLLATE "pg_catalog"."default",
  "status" varchar(255) COLLATE "pg_catalog"."default",
  "room_id" int4,
  "user_id" int4
)
;
ALTER TABLE "public"."booking" OWNER TO "postgres";

-- ----------------------------
-- Records of booking
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for feedback
-- ----------------------------
DROP TABLE IF EXISTS "public"."feedback";
CREATE TABLE "public"."feedback" (
  "id" int4 NOT NULL DEFAULT nextval('feedback_id_seq'::regclass),
  "comment" varchar(255) COLLATE "pg_catalog"."default",
  "email" varchar(255) COLLATE "pg_catalog"."default",
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "rating" int4
)
;
ALTER TABLE "public"."feedback" OWNER TO "postgres";

-- ----------------------------
-- Records of feedback
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for room
-- ----------------------------
DROP TABLE IF EXISTS "public"."room";
CREATE TABLE "public"."room" (
  "id" int4 NOT NULL DEFAULT nextval('room_id_seq'::regclass),
  "bath" bool,
  "bed" int4,
  "capacity" int4,
  "description" varchar(255) COLLATE "pg_catalog"."default",
  "internet" bool,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "price" int4,
  "status" varchar(255) COLLATE "pg_catalog"."default",
  "type" int4
)
;
ALTER TABLE "public"."room" OWNER TO "postgres";

-- ----------------------------
-- Records of room
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for room_image
-- ----------------------------
DROP TABLE IF EXISTS "public"."room_image";
CREATE TABLE "public"."room_image" (
  "room" varchar(5) COLLATE "pg_catalog"."default",
  "id" int4,
  "name" varchar(255) COLLATE "pg_catalog"."default",
  "url" varchar(255) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."room_image" OWNER TO "postgres";

-- ----------------------------
-- Records of room_image
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for room_type
-- ----------------------------
DROP TABLE IF EXISTS "public"."room_type";
CREATE TABLE "public"."room_type" (
  "id" int4 NOT NULL,
  "base_price" int4,
  "type" varchar(10) COLLATE "pg_catalog"."default"
)
;
ALTER TABLE "public"."room_type" OWNER TO "postgres";

-- ----------------------------
-- Records of room_type
-- ----------------------------
BEGIN;
INSERT INTO "public"."room_type" VALUES (1, 1500, 'FAMILY');
INSERT INTO "public"."room_type" VALUES (2, 2000, 'DELUXE');
INSERT INTO "public"."room_type" VALUES (3, 2500, 'EXECUTIVE');
COMMIT;

-- ----------------------------
-- Table structure for user_profile
-- ----------------------------
DROP TABLE IF EXISTS "public"."user_profile";
CREATE TABLE "public"."user_profile" (
  "type" varchar(10) COLLATE "pg_catalog"."default",
  "id" int4
)
;
ALTER TABLE "public"."user_profile" OWNER TO "postgres";

-- ----------------------------
-- Records of user_profile
-- ----------------------------
BEGIN;
INSERT INTO "public"."user_profile" VALUES ('USER', NULL);
INSERT INTO "public"."user_profile" VALUES ('ADMIN', NULL);
INSERT INTO "public"."user_profile" VALUES ('MANAGER', NULL);
INSERT INTO "public"."user_profile" VALUES ('UNVERIFIED', NULL);
COMMIT;

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."booking_id_seq"
OWNED BY "public"."booking"."id";
SELECT setval('"public"."booking_id_seq"', 2, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."feedback_id_seq"
OWNED BY "public"."feedback"."id";
SELECT setval('"public"."feedback_id_seq"', 2, false);

-- ----------------------------
-- Alter sequences owned by
-- ----------------------------
ALTER SEQUENCE "public"."room_id_seq"
OWNED BY "public"."room"."id";
SELECT setval('"public"."room_id_seq"', 2, false);

-- ----------------------------
-- Primary Key structure for table booking
-- ----------------------------
ALTER TABLE "public"."booking" ADD CONSTRAINT "booking_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table feedback
-- ----------------------------
ALTER TABLE "public"."feedback" ADD CONSTRAINT "feedback_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Uniques structure for table room
-- ----------------------------
ALTER TABLE "public"."room" ADD CONSTRAINT "uk_4l8mm4fqoos6fcbx76rvqxer" UNIQUE ("name");

-- ----------------------------
-- Primary Key structure for table room
-- ----------------------------
ALTER TABLE "public"."room" ADD CONSTRAINT "room_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Primary Key structure for table room_type
-- ----------------------------
ALTER TABLE "public"."room_type" ADD CONSTRAINT "room_type_pkey" PRIMARY KEY ("id");

-- ----------------------------
-- Foreign Keys structure for table booking
-- ----------------------------
ALTER TABLE "public"."booking" ADD CONSTRAINT "fkq83pan5xy2a6rn0qsl9bckqai" FOREIGN KEY ("room_id") REFERENCES "public"."room" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;

-- ----------------------------
-- Foreign Keys structure for table room
-- ----------------------------
ALTER TABLE "public"."room" ADD CONSTRAINT "fkn6dyum2wrimvhdtsc09ipegvr" FOREIGN KEY ("type") REFERENCES "public"."room_type" ("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
